package com.example.one;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final Intent it = new Intent(this, Main3Activity.class);
        SharedPreferences sharedPreferences= MyApplication.getSharedPre();
        boolean bool=sharedPreferences.getBoolean("wel",false);
        if(bool){
            //进入欢迎页面
            startActivity(new Intent(this,Main2Activity.class));
        }else{
            //进入引导页面

            Timer timer = new Timer();
            TimerTask task = new TimerTask() {
                @Override
                public void run() {
                    startActivity(it);
                    finish();
                }
            };
            timer.schedule(task,4000);
        }


    finish();
}
}
